package com.foreknow.dao;

import com.foreknow.entity.Department;
import com.foreknow.entity.Rule;
import com.foreknow.entity.Scheduling;
import com.foreknow.entity.User;

import java.util.Date;
import java.util.List;

public interface SchedulingMapper {
    /**
     * 查询所有值班人员数据
     *
     * @return
     */
    public List<Scheduling> selectAll(String query);

    /**
     * 根据日期查询值班人员
     *
     * @param startTime
     * @param endTime
     * @return
     */
    List<Scheduling> selectSome(String startTime, String endTime);

    /**
     * 根据科室以及挂号级别查询医生
     *
     * @return
     */

    List<User> selectUserDoctor(String dept, String level);

    /**
     * 根据姓名查询用户
     *
     * @param name
     * @return
     */
    User selectIdByName(String name);

    /**
     * 添加值班规则
     *
     * @param
     * @return
     */
    int insertRule(Rule rule);

    List<Department> selectDepartAll();

    int deleteByPrimaryKey(Integer id);

    /**
     * 选取规则生成排班计划
     *
     * @param
     * @return
     */
    int insert(List<Scheduling> list);

    int insertSelective(Scheduling record);


//    int insertSche(List<Scheduling> schedulinglist,Date scheddate1,Date scheddate2);

    Scheduling selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Scheduling record);

    int updateByPrimaryKey(Scheduling record);

    /**
     * 根据UserId与Week查找RuleId
     *
     * @param week
     * @param id
     * @return
     */
    int selectRuleId(String week, Integer id);
}